package com.rui.study.algorithm.P_二叉树中序遍历;

import com.rui.study.algorithm.TreeNode;

import java.util.ArrayList;
import java.util.List;

/**
 * @program: study
 * @description:
 * @author: Yaowr
 * @create: 2019-01-14 10:08
 **/
public class Solution {
    List<Integer> result = new ArrayList<>();
    public List<Integer> inorderTraversal(TreeNode root) {
        if (root != null) {
            inorderTraversal(root.left);
            result.add(root.val);
            inorderTraversal(root.right);
        }
        return result;
    }
}
